package com.ailiwu.www.ailiwu.activity;

import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.TextView;

import com.ailiwu.www.ailiwu.R;
import com.ailiwu.www.ailiwu.base.BaseActivity;

public class ResultActivity extends BaseActivity {
    private String scanResult;
    private TextView tv_scan_result;
    private WebView wv_result;

    @Override
    protected void loadXml() {
        setContentView(R.layout.activity_result);
    }

    @Override
    protected void getIntentData(Bundle savedInstanceState) {
        scanResult = getIntent().getStringExtra("SCANRESULT");
    }

    @Override
    protected void initView() {
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayShowTitleEnabled(false);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowCustomEnabled(true);

        wv_result = (WebView) findViewById(R.id.wv_result);
        WebSettings webSettings = wv_result.getSettings();
        webSettings.setDefaultTextEncodingName("UTF-8");
        webSettings.setJavaScriptEnabled(true);
        webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
    }
    @Override
    protected void setListener() {

    }
    @Override
    protected void initData() {
        Log.i("oye" , scanResult);
        wv_result.loadUrl(scanResult);
    }
}
